<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>
  <form action="{:U('brandEdit')}" method="post" class="form-horizontal">
    <div class="form-item">
      <label class="item-label">品牌名称<span class="check-tips">（申请品牌的目的是方便买家通过品牌索引页查找商品，申请时请填写品牌所属的类别，方便平台归类。在平台审核前，您可以编辑或撤销申请）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="name" value="{$data.name|default=''}">
      </div>
    </div>
    <div class="form-item cf">
            <label class="item-label">商品分类</label>
            <div class="controls" id="J_itemCategory">加载中...</div>
            <input type="hidden" value="" name="category" id="J_category">
          </div>
    <div class="form-item">
      <label class="item-label">品牌LOGO<span class="check-tips">（品牌LOGO尺寸要求宽度为150像素，高度为50像素的图片；支持格式gif,jpg,png）</span></label>
      <div class="controls">
        {:hook('uploadImages', array('name' => 'pic', 'value' => $data['pic'], 'tpl' => 'baidu/img'))}
      </div>
    </div>
    <div class="form-item">
      <input type="hidden" name="id" value="{$data.id|default=''}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
<script src="__JS__/jquery/jquery.loadtype.js"></script> 
  <script type="text/javascript">
    //导航高亮
    highlight_subnav("{:U('brand')}");
    Core.setValue("cid", {$data.cid|default = 0});
    $('#J_itemCategory').loadtype({
        type: 'itemCategory',
        store_id: "{$store_id}",
        name1: 'cid_1',
        name2: 'cid_2',
        name3: 'cid_3',
        value1: "{$cid_1}",
        value2: "{$cid_2}",
        value3: "{$cid_3}",
        changed: function(c1, c2, c3){
          var c_array = [];
          c1 && c_array.push($('select[name="cid_1"] option:selected').text());
          c2 && c_array.push($('select[name="cid_2"] option:selected').text());
          c3 && c_array.push($('select[name="cid_3"] option:selected').text());
          $('#J_category').val(c_array.join('/'));
        },
      });
  </script>
</block>